#!/usr/bin/perl -w
@second_name = ();

sub greet {
my $name = $_[0];

if ( defined $second_name[0] ) {
  print "Hi $name! @second_name is also in there \n"; 
  } else {
  print "Hi $name You are first in there \n";
  }
unshift (@second_name, $name);
}
 
&greet ( Fred );
&greet ( Barney );
&greet (Alex);
